//
// Created by liang on 2025/4/5.
//

#ifndef QT6_TEST_GLOBALCONTEXT_H
#define QT6_TEST_GLOBALCONTEXT_H


namespace SS {
    class GlobalContext {
    public:
        static GlobalContext* getInstance(){
            if (instance == nullptr) {
                instance = new GlobalContext;
            }
            return instance;
        }
        GlobalContext(): isStartUp(false), index(0){}
        GlobalContext(GlobalContext&) = delete;
        GlobalContext& operator=(const GlobalContext&) = delete;
        bool getIsStartUp() const;

        void setIsStartUp(bool isStartUp);
        int getIndex() {
            return index++;
        };
    private:
        bool isStartUp;
        static GlobalContext* instance;
        int index;
    };

}

#endif //QT6_TEST_GLOBALCONTEXT_H
